// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import "Language.js" as Language

Item {
    id: musicwidget
    width: 250
    height: 100
    signal openFullMusic()
    function updateMusic()
    {
        trackInfoText.text = qsTr(Language.currentTrack);
        console.log("should be updating song");
    }

    MouseArea{
        x:0;y:0
        width:parent.width
        height:parent.height
        onClicked: {console.log("Music Widget Clicked"); openFullMusic();}
    }

    Image {
        id: playicon
        x: 100
        y: 25
        width: 50
        height: 50
        z: 2
        source: "Assets/music/play.png"
        smooth: true
        MouseArea{
            x:0
            y:0
            width: 50
            height: 50
            onClicked: {playicon.visible=false;pauseicon.visible=true;}
        }
    }
    Image {
        id: pauseicon
        x: 100
        y: 25
        width: 50
        height: 50
        z: 2
        source: "Assets/music/pause.png"
        smooth: true
        visible: false
        MouseArea{
            x:0
            y:0
            width: 50
            height: 50
            onClicked: {playicon.visible=true;pauseicon.visible=false;}
        }
    }
    Image {
        id: nexticon
        x: 174
        y: 25
        width: 50
        height: 50
        source: "Assets/music/next.png"
        smooth: true
    }
    Image {
        id: backicon
        x: 19
        y: 25
        width: 50
        height: 50
        source: "Assets/music/back.png"
        smooth: true
    }
    /*Image {
        id: speaker_onicon
        x: 18
        y: 25
        width: 50
        height: 50
        source: "Assets/music/speakeron.png"
        smooth: true
        MouseArea{
            x:0
            y:0
            height:50
            width:50
            onClicked:{speaker_onicon.visible=false;speaker_officon.visible=true;}
        }
    }*/
    /*Image {
        id: speaker_officon
        x: 18
        y: 25
        width: 50
        height: 50
        source: "Assets/music/speakeroff.png"
        smooth: true
        visible:false
        MouseArea{
            x:0
            y:0
            height:50
            width:50
            onClicked:{speaker_onicon.visible=true;speaker_officon.visible=false;}
        }
    }*/
    /*
    Image {
        id: coverarticon
        x: 390
        y: 8
        width: 100
        height: 100
        source: "Assets/music/coverart.png"
        smooth: true
    }*/
    Rectangle {
      id: slider;
      width: 236; height: 10;
      anchors.centerIn: parent
      property int value: Math.round(handle.x*100/(slider.width-handle.width))
      x: 7
      y: 108
      radius: 10
      z: 2
      color: "black"
      anchors.verticalCenterOffset: 38
      anchors.horizontalCenterOffset: 0
      Rectangle {
        id: handle; width: 40; height: 10
        color: "gray"
        radius: 10
        MouseArea {
          anchors.fill: parent
          drag.target: parent; drag.axis: "XAxis"
          drag.minimumX: 0; drag.maximumX: slider.width - handle.width
        }
      }
    }

    Text {
        id: trackInfoText
        x: 0
        y: 0
        width:parent.width
        height:34
        text: qsTr(Language.currentTrack)
        horizontalAlignment: Text.AlignHCenter
        font.pixelSize: 26
    }

}
//Westin
